import request from '@/utils/request'

// 获取角色列表
export const getRoleList = params => request.get('/sys/role', {
  params
})

// 删除
export const delRole = id => request.delete(`/sys/role/${id}`)

// 添加角色
export const addRole = data => request.post('/sys/role', data)

// 获取角色详情
export const getRoleDetail = id => request.get(`/sys/role/${id}`)

// 更新角色
export const updateRole = data => request({
  url: `/sys/role/${data.id}`,
  method: 'PUT',
  data
})

// 获取公司信息
export const getCompanyInfo = id => request.get(`/company/${id}`)

// 给角色分配权限
export const assignPerm = data => request.put('/sys/role/assignPrem', data)
